<?php

namespace App\Repository\Msq;

use App\Model\File\FileModel;
use App\Repository\RepositoryGeneral;
use Hyperf\Di\Annotation\Inject;

class FileMsq extends RepositoryGeneral
{
    #[Inject]
    private FileModel $fileModel;

    public function addFile($data){
        return $this->fileModel->withCustomCondition()->create($data)->id;
    }

    public function getFile($fileId){
        return $this->fileModel->withCustomCondition()->where('id',$fileId)->first();
    }

    public function getFileByMd5($md5){
        return $this->fileModel->withCustomCondition()->where('file_md5',$md5)->first();
    }
}